<?php

use yii\db\Migration;

/**
 * Handles the creation of table `generalocr`.
 */
class m180109_051946_create_generalocr_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('generalocr', [
            'id' => $this->bigPrimaryKey(),
            'title' => $this->string()->notNull()->comment('案卷名称'),
            'filename' => $this->string()->notNull()->comment('文件名'),
            'path' => $this->string()->notNull()->comment('文件路径'),
            'ocr_ret' => $this->text()->notNull()->comment('主体包内容'),
            'ocr_string' => $this->text()->notNull()->comment('字段字符串'),
            'user_id' => $this->integer()->notNull()->comment('上传人'),
            'ocr_origin' => $this->string()->notNull()->defaultValue('tencent')->comment('识别来源'),
            'created_at' => $this->timestamp()->notNull(),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('generalocr');
    }
}
